const express = require('express');
const db = require('../utils/db');
const router = express.Router();

router.get('/getMain', (req, res) => {
    const sql = `select * from main;`;
    db.query(sql, (err, data) => {
        if (err) {
            res.send({ error: 1, msg: err })
        } else {
            // console.log(data);
            if (data.length > 0) {
                res.send({ error: 0, data: data })

            } else {
                res.send({ error: 1, msg: err })
            }

        }
    })
})
module.exports = router;